package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 房源信息对象 rent_property
 * 
 * @author ssd
 * @date 2024-03-25
 */
public class SysProperty extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 房源ID */
    private Long propertyId;
    /** 名称 */
    @Excel(name = "房源名称")
    @NotBlank(message = "房源名称不能为空")
    private String name;

    /** 地址 */
    @Excel(name = "地址")
    @NotBlank(message = "地址不能为空")
    private String address;

    /** 户型 */
    @Excel(name = "户型")
    @NotNull(message = "户型不能为空")
    private String layout;

    /** 价格 */
    @Excel(name = "价格")
    @DecimalMin(value = "0.01", message = "价格必须大于等于0.01")
    private BigDecimal price;

    /** 其他相关信息 */
    @Excel(name = "其他相关信息")
    private String otherInfo;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date creatTime;

    /** 是否删除 */
    private Integer delFlag;

    /** 图片 */
    @Excel(name = "图片")
    private String photo;

    /** 房源状态0：可租，1：不可租 */
    @Excel(name = "房源状态0：可租，1：不可租")
    private Integer status;

    /** 押金 */
    @Excel(name = "押金")
    
    private BigDecimal deposit;

    /** 抵押规则：0：无押金、1：押一付一、3：押一付三 */
    @Excel(name = "抵押规则：0：无押金、1：押一付一、3：押一付三")
    @NotNull(message = "抵押规则不能为空")
    private Integer depositRule;

    /** 房主对象 */
    @Excel(name = "房东名称", targetAttr = "userName", type = Excel.Type.EXPORT)

    private SysUser homeowner;
    /** 合同对象 */
    @Excel(name = "合同", targetAttr = "contract", type = Excel.Type.EXPORT)

    private SysContract contract;
    /** 合同id */
    @Excel(name = "合同id", targetAttr = "contractId", type = Excel.Type.EXPORT)

    private Long contractId;

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public SysContract getContract() {
        return contract;
    }

    public void setContract(SysContract contract) {
        this.contract = contract;
    }

    public void setPropertyId(Long propertyId)
    {
        this.propertyId = propertyId;
    }

    public Long getPropertyId() 
    {
        return propertyId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAddress(String address)
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }
    public void setLayout(String layout) 
    {
        this.layout = layout;
    }

    public String getLayout() 
    {
        return layout;
    }
    public void setPrice(BigDecimal price) 
    {
        this.price = price;
    }

    public BigDecimal getPrice() 
    {
        return price;
    }
    public void setOtherInfo(String otherInfo) 
    {
        this.otherInfo = otherInfo;
    }

    public String getOtherInfo() 
    {
        return otherInfo;
    }
    public void setCreatTime(Date creatTime)
    {
        this.creatTime = creatTime;
    }

    public Date getCreatTime()
    {
        return creatTime;
    }
    public void setDelFlag(Integer delFlag)
    {
        this.delFlag = delFlag;
    }

    public Integer getDelFlag() 
    {
        return delFlag;
    }
    public void setPhoto(String photo) 
    {
        this.photo = photo;
    }

    public String getPhoto() 
    {
        return photo;
    }
    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }
    public void setDeposit(BigDecimal deposit) 
    {
        this.deposit = deposit;
    }

    public BigDecimal getDeposit() 
    {
        return deposit;
    }
    public void setDepositRule(Integer depositRule) 
    {
        this.depositRule = depositRule;
    }

    public Integer getDepositRule() 
    {
        return depositRule;
    }

    public SysUser getHomeowner() {
        return homeowner;
    }

    public void setHomeowner(SysUser homeowner) {
        this.homeowner = homeowner;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("propertyId", getPropertyId())
            .append("address", getAddress())
            .append("layout", getLayout())
            .append("price", getPrice())
            .append("otherInfo", getOtherInfo())
            .append("creatTime", getCreatTime())
            .append("updateTime", getUpdateTime())
            .append("delFlag", getDelFlag())
            .append("photo", getPhoto())
            .append("status", getStatus())
            .append("deposit", getDeposit())
            .append("depositRule", getDepositRule())
            .append("homerowern",getHomeowner())
            .append("contract", getContract())
            .toString();
    }
}
